package com.content;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Value("${cbs.fileListPath}")
    private String fileListPath;
    @Value("${cbs.viedosPath}")
    private String viedosPath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        /**
         * http://[ip]:[port]/[context-path]/images/文件名字
         * http://127.0.0.1:8080/localFiles/House.java
         */
        registry.addResourceHandler("/localFiles/**").addResourceLocations(fileListPath).addResourceLocations(viedosPath);
    }

}
